package cn.yj.cgs.dba.mapper;

import cn.yj.annotation.pagehelper.annotation.StartPage;
import cn.yj.annotation.pagehelper.page.Page;
import cn.yj.cgs.dba.entity.Article;
import cn.yj.cgs.dba.entity.vo.ArticleVo;
import cn.yj.common.NameValue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;


/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 永健
 * @since 2021-04-19 16:12:11
 */
public interface ArticleMapper extends BaseMapper<Article>{

    @StartPage
    List<ArticleVo> findList(@Param("map") Map<String, Object> map, @Param("page") Page<? extends Article> page);

    @StartPage
    List<ArticleVo> findListPc(@Param("map") Map<String, Object> map, @Param("page") Page<? extends Article> page);

    Article selectByNoForUpdate(String articleNo);

    List<String> selectListUserCodeByDate(Date date);

    long  selectCountByCodeAndDate(@Param("userCode") String userCode,@Param("date") Date date);

    long countByDateRange(@Param("startTime") Date startDate,@Param("endTime") Date endDate);

    long countByDate(Date date);

    long countAll();

    List<NameValue> pieChart();
}
